Skip to content

fix(plugins): keep SessionStart profiles within UTF-8 byte caps - #5748

Open
ktz03 wants to merge 11 commits into
volcengine:mainfrom
ktz03:fix/profile-byte-budget
Open

ktz03 wants to merge 11 commits into
volcengine:mainfrom
ktz03:fix/profile-byte-budget

Conversation

@ktz03

@ktz03 ktz03 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Current verification — main synchronization (2026-11-24)

Head 5e7c8d36514b9cba40809c5c0c632d0dc45d25d5 normally merges main 300ab8eb0746d917b7b968b7f739a28a5a5c04b5. The conflict resolution preserves the original fix and current upstream behavior.

Adapted byte budgeting to main's dual user/peer profiles while preserving profile ordering, complete envelopes and the peer pointer. The 29-case profile suite passes; the exact main control has three failures. Nine synchronization checks, paired metadata/locks and the actual-HEAD seven-plugin version gate pass. The focused matrices overlap and are not added together.

The current-head official workflows report action_required, with zero actual jobs at 2026-11-24 02:59:52 UTC. They have not executed and are not CI passes. Earlier verification sections below remain attached to their named historical heads.

Description

SessionStart profiles with a CJK-heavy prefix and a long ASCII tail can exceed the default sessionStartMaxBytes limit. The character estimate uses the complete profile's density, which differs from the retained prefix. After dropping the index and catalog, the builder previously returned the oversized profile unchanged.

Re-budget the remaining profile in the canonical shared builder using its actual retained UTF-8 bytes. The default mixed-profile reproduction changes from 10,527 bytes to 9,500 bytes for a 9,500-byte helper budget; real Claude/Codex startup children now emit 9,458/9,464 bytes of context within their 9,500-byte setting. This extends the existing profile and catalog work in #1914 and #5161.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #5742

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Preserve the existing index-then-catalog drop order, then reuse profile elision with a byte budget that includes complete opening/closing tags. Keep head/tail content where it fits, truncate a long head on Unicode code-point boundaries, and omit profiles that cannot fit a complete marked envelope.
  • Preserve fitting profiles and uncapped output. Add mixed-density, small-cap, Unicode, complete-envelope and normal-output regressions; strengthen the existing 1,000-byte assertion. Host entrypoints and the generic truncateToBytes helper remain unchanged.
  • Regenerate shared copies, update the six affected plugin versions with paired metadata/locks, and document the positive-cap behavior in English and Chinese. Dependency contents are unchanged.

Testing

Current verification — main 49f7780 synchronization (2026-10-09)

Current head d6815f87f0388cf46b8301d4810f4673a8b0bec2 ordinarily merges exact official main 49f778011ef4f0b556d6064d4ec90343643668cf into previous head c897f9d3ebc847326982359b7a5b47eddd166874. The original fix and regression tests and every non-owned automatic-merge entry are preserved. Upstream #5459, #5661, #5790 OpenClaw/Pi transport fixes, the gateway rename and DSH changes are retained. Beyond the clean automatic merge, only 17 version fields in 15 owned metadata files change; dependency entries remain unchanged. The six owned releases are Claude 0.7.7, Codex 0.11.6, agent hooks 0.5.15, OpenCode 0.5.9, DSH 0.5.21, and Pi 0.4.14, each strictly newer than main. Paired host/package/config/runtime/lock versions align.

This PR's exact tree dd0481eaade2904136aaced5c541be65eab6f1e4 was tested separately on Windows and Ubuntu WSL with Node 24.21.0: profile injection 18 passed, shared release config/sync/HTTP contracts 97 passed, and current Codex config/marketplace/usage 41 passed on each platform. Current-main DSH controls give 95 passed / 1 opt-in live-recall skip on each platform. These matrices overlap and are not added together. Existing cached dependencies were reused; no fresh dependency installation occurred.

The official generator leaves tracked output unchanged, relevant module syntax passes, and the unchanged version gate passes on the real committed HEAD. Independent reviews verified actual log byte/hash/TAP results, exact tested/prepared/committed tree linkage, ordinary commit parents, metadata-only edits, retained upstream entries and source cleanliness. Earlier broader Windows failures or skips below remain historical; this refresh does not assert Windows-wide or full repository success.

Current official CI

Current head d6815f87f0388cf46b8301d4810f4673a8b0bec2: 6 SUCCESS / 5 conditional SKIPPED / 0 FAILURE. All 3 current-head parent runs completed (checked 2026-10-09T06:45:01.835426+00:00). Conditional jobs did not execute.

API/CLI job 113686915261 completed 2026-10-09T06:02:12Z: SUCCESS; filesystem API 14 passed, basic API 54 passed / 1 skipped, released CLI v0.4.4 compatibility 16 passed, source CLI 25 passed / 21 skipped, with zero test failures. Skipped cases are not counted as executed coverage.

The basic-API skip is a Find request returning 401 because PR CI cannot access VLM/Embedding API keys. The 21 source-CLI skips comprise 19 unavailable upstream-authentication cases, one existing CLI/server timeout-parameter mismatch, and one unavailable skill fixture for show. These skips do not establish complete authentication or model coverage.

Conditional skips: Build and Deploy Docs, cuvs-tests, langchain-tests, build, sdk-python-tests. These jobs did not execute.

The newly completed API/CLI job's full 549,095-byte log was read. Prior full-log evidence for the other 5 completed non-skipped jobs (371,695 bytes) is reused for the unchanged run/job metadata signatures; those old logs were not downloaded or read again. Dependency and version jobs are static checks.

The API/CLI log records official checkout 2fb6ad49edf2c18d66cb084b87205a63da1e20d2, with exact main 49f778011ef4f0b556d6064d4ec90343643668cf and this head as parents. Its tree dd0481eaade2904136aaced5c541be65eab6f1e4 matches this PR's reviewed and locally tested tree.

These checks do not establish complete authentication or model coverage, a deployed OpenViking service, real host UI/IM, macOS or performance coverage. Historical results retain their named heads and platform limits.

Historical verification — main 961fb46 synchronization (2026-10-08)

Current head c897f9d3ebc847326982359b7a5b47eddd166874 normally merges main 961fb4639505cff3051cc8faf74c757d50e085f0 into f96f2347e00b04579122ad6b47527c45be6d27f6. The original fix and regressions are retained, including the upstream #5738 usage/configuration changes and #5733 dependency ranges and lock entries. Beyond the automatic merge, only 13 version fields in 12 metadata files advance the five affected releases. Versions are Claude 0.7.6, Codex 0.11.5, agent hooks 0.5.14, OpenCode 0.5.8, DSH 0.5.20, and Pi 0.4.13; paired/config/lock versions align and all six strictly exceed main. DSH 0.5.20 is unchanged by this second refresh.

On the complete real committed source tree, Linux with fresh locked DSH/Pi/OpenClaw dependencies: official plugin selection 1278 passed / 8 skipped, installer 22 passed, and OpenClaw 42 files / 746 tests passed (architecture-boundaries.test.ts excluded). Windows profile/agent-profile/config/sync/SessionStart/usage scopes: 149 passed. The Windows compatibility matrix covers 14 helper controls and seven real Claude plus seven real Codex child controls; the original fitting/zero-cap behavior remains byte-exact. The controlled mixed-text reproduction uses synthetic profiles and actual hook children, without establishing natural host frequency.

The generator and version gate on the real committed HEAD pass. Matrices overlap and are not added together. Eight full-plugin skips mean one live recall, four optional Pi SessionManager cases, and three optional Pi transcript-helper cases. No full local server/API, live authentication/models, deployed OpenViking server, real host UI/IM, macOS or performance validation is claimed.

Historical official CI — before head d6815f8

Official checks rechecked at 2026-10-08T11:58:34.700074+00:00 for head c897f9d3ebc847326982359b7a5b47eddd166874: 6 SUCCESS / 5 SKIPPED / 0 failures. All 3 parent runs and all actual jobs are completed.

  • Plugin job 113262734591: 1278 passed / 8 skipped / 0 failed; installer 22 passed / 0 skipped / 0 failed. The eight plugin skips are one opt-in live recall, four optional Pi SessionManager cases and three optional Pi transcript-helper cases.
  • API/CLI job 113262732453: filesystem 14 passed; basic API 54 passed / 1 skipped; released CLI 0.4.4 compatibility 16 passed; source CLI 25 passed / 21 skipped. The basic Find test skips after a 401 because embedding credentials are unavailable. Source CLI skips are 19 upstream-authentication cases, one existing timeout-parameter mismatch, and one missing show-skill fixture.
  • OpenClaw job 113266714592: 42 files / 746 tests passed. The official command excludes architecture-boundaries.test.ts; it was not executed.
  • Docs job 113262732860: 61 tests passed / 0 failed / 0 skipped, with the docs build and built-link/anchor checks successful. Deployment is conditionally skipped.
  • check-deps 113262734379 and plugin-versions 113262734755 succeed; these are static dependency/version checks.

Conditional skips: Build and Deploy Docs, build, cuvs-tests, langchain-tests, sdk-python-tests. These jobs were not executed.

All 6 completed non-skipped job logs / 919,591 bytes were read in full and verified against fresh complete run/job metadata. Every log records checkout 972dff6d4d3c3ecac6eafa584ca1ce1c7c8ae652; its REST-confirmed parents are main 961fb4639505cff3051cc8faf74c757d50e085f0 and head c897f9d3ebc847326982359b7a5b47eddd166874, and tree a8848f4cbef4df4099b4d24b10de27300408bd2c exactly matches the reviewed/committed tree.

These results cover the recorded main 961fb463 checkout. They do not establish results for a later complete main merge, full authentication/VLM/Embedding, a deployed OpenViking service, real-host UI/IM, online-model behavior, macOS or performance. Historical results below remain attached to their named heads.

Historical local validation — before head c897f9d

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

The final 18-test profile suite changes from 16 passes / 2 failures on the unchanged baseline to 18 passes. The c7e baseline profile source is byte-identical to the 7d77 submission base; the defect was also reproduced through the public helper and actual startup child on 7d77.

On Windows, the profile/config/sync and Claude/Codex SessionStart selection passes 108 tests. A broader shared selection passes 138 tests with one symlink-creation EPERM before product execution; the unchanged 7d77 control reproduces that same failure (20 passes / 1 failure). The unchecked all-tests box reflects this Windows environment limitation.

On Linux, a complete tracked snapshot of commit d2dcaa7939af87f5a10be72f1cea98d94f42f6bc, with fresh locked DSH/Pi dependencies, passes the official plugin file selection at concurrency 1: 1277 passed / 8 skipped, plus 22 installer tests. The skips are one opt-in live recall, four optional Pi session-manager and three optional transcript-helper cases. Fresh locked OpenClaw dependencies pass 42 files / 746 tests, using the official exclusion of architecture-boundaries.test.ts; that file was not executed. Generator idempotence, syntax checks and the version gate on the real committed HEAD pass.

An independent review confirms the same 14 helper controls and seven scenarios per real Claude/Codex startup child on Windows and WSL. Normal and uncapped outputs are byte-exact against the baseline; byte limits, Unicode, complete tags, head/tail, drop order and metrics pass. These matrices overlap and are not added together. Child processes use synthetic profiles over loopback HTTP; real host UI, OpenViking deployment, online models and performance were not tested.

Historical verification — f96f234 before main 961fb46

Current head f96f2347e00b04579122ad6b47527c45be6d27f6 normally merges main 57a6ea5fdef4f62456996d3dac5583ba36fe1420. The upstream DSH 0.5.19 release arrived after the initial PR; the first official version check fetched that newer main and reported DSH's unchanged 0.5.19. The refresh retains all upstream branding/icon changes and raises only the four DSH configuration/package/lock version fields to 0.5.20. The original profile implementation, tests, documentation and generated copies are byte-exact. All six releases and paired metadata pass the real committed-HEAD gate against this main; dependency contents remain unchanged.

On this merged tree, Windows reruns the 18 profile regressions and DSH 95 passed / 1 opt-in live skip. WSL uses a complete tracked snapshot with fresh locked DSH dependencies: DSH 95 passed / 1 skip, and profile/configuration/synchronization 92 passed. The same 14 helper controls and seven real startup-child scenarios for each Claude/Codex host pass on both platforms. Generator and syntax checks pass. These scopes overlap; the full plugin result (1277 passed / 8 skipped), installer22 and OpenClaw746 above belong to initial d2dc, and were not repeated for this merged tree. Real host UI, deployed OpenViking, online models and performance remain outside local validation.

Current main 35fa35bea39cd60503060f0f82de111e21a50844 subsequently changes only .github/workflows/docs-tos.yml. The actual clean merge has the same nine tested plugin subtrees and release versions as this head; the complete later workflow tree was not tested locally. Official CI uses the earlier 57a6 merge.

Historical official CI — f96f234 before main 961fb46

Current head f96f2347e00b04579122ad6b47527c45be6d27f6: 6 successful / 5 conditional skips / 0 unfinished checks at 2026-10-08T09:21:20.786499+00:00. The completed checks' entire run/job objects and six full logs were read for this head:

  • Plugin tests: 1277 passed / 8 skipped, then installer 22 passed. The eight skips retain the live-recall/optional-Pi scope above.
  • OpenClaw: 42 files / 746 tests passed; the official command excludes architecture-boundaries.test.ts, which was not executed.
  • Plugin versions and dependencies succeed; the DSH release collision from initial d2dc is resolved on this head. Docs pass 61 tests and build successfully.
  • API/CLI completed successfully at 2026-10-08T09:20:12Z. Filesystem tests pass 14, basic API tests pass 54 / 1 skipped (Find returns 401 because embedding credentials are unavailable), released CLI 0.4.4 compatibility passes 16, and source CLI integration passes 25 / 21 skipped. Those source skips are 19 unavailable upstream authentication cases, 1 existing CLI/server timeout-parameter mismatch and 1 unavailable show-skill fixture. Results from the initial head remain historical.

Official checkout 9f30f93836aa18a4f3fe7934de18143640bd3c37 has actual parents main 57a6ea5fdef4f62456996d3dac5583ba36fe1420 and this head; its tree 6c1bd6ae203db445cc918700106bac8737a28ece equals the independently reviewed/committed tree. Conditional skips and these results do not establish real host UI, full authentication/model coverage or performance validation.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

No dependent PR is required. The six releases are Claude 0.7.6, Codex 0.11.5, agent-hook 0.5.14, OpenCode 0.5.8, DSH 0.5.20 and Pi 0.4.13, each strictly above main 961fb4639505cff3051cc8faf74c757d50e085f0.

Maintenance validation (2026-10-12, main 9093583)

Synchronized this existing branch with upstream 9093583b34050619ba6f5a6a11b003b0adca15e7 after the upstream plugin releases changed. The affected release versions are now Claude 0.7.9, Codex 0.11.8, agent-hook 0.5.17, OpenCode 0.5.11, DSH 0.5.23, and Pi 0.4.16, strictly above that main. Paired manifests, configuration, and lock metadata remain consistent.

Windows and Linux each pass 18 focused regressions, 97 release/configuration checks, and 41 Codex configuration/marketplace checks. The DSH suite passes 95 checks and skips one live-host check on each platform. Syntax, generated-copy consistency, and the version gate also pass on the actual commit. These suites overlap and their counts are not added. Ignored runtime dependencies are cached; this validation does not cover a live host, model, deployment, or the full server.

For current head bcf1b7ac627b12ea5074c2098469306f5da90c79, the actual official jobs read at 2026-10-12T05:41:02.720517+00:00 report 1 in_progress, 4 queued, 1 skipped. Conditional skips are not executions; queued or running jobs are not passes. Earlier CI/validation sections describe their earlier heads.

Maintenance validation (2026-10-12, main 2e706d7)

Synchronized this existing branch with upstream 2e706d7193aa47c05d986e68b61b3b994d41fa55 after the upstream plugin releases changed. The affected release versions are now Claude 0.7.10, Codex 0.11.9, agent-hook 0.5.18, OpenCode 0.5.12, DSH 0.5.24, and Pi 0.4.17, strictly above that main. Paired manifests, configuration, and lock metadata remain consistent.

Windows and Linux each pass 48 focused regressions (including the 30 current-main capture-text regressions), 97 release/configuration checks, and 41 Codex configuration/marketplace checks. The DSH suite passes 95 checks and skips one live-host check on each platform. Syntax, generated-copy consistency, and the version gate also pass on the actual commit. These suites overlap and their counts are not added. Ignored runtime dependencies are cached; this validation does not cover a live host, model, deployment, or the full server.

For current head ceb5aa148c014de451bc7730a38e14afc979e66c, the actual official job payloads collected between 2026-10-12T07:07:27.336948+00:00 and 2026-10-12T07:07:31.247684+00:00 report 5 in_progress, 1 skipped. Conditional skips are not executions; queued or running jobs are not passes. Earlier CI/validation sections describe their earlier heads.

@ktz03
ktz03 marked this pull request as ready for review October 9, 2026 02:30
@ZaynJarvis ZaynJarvis added the agent-plugins Agent harness and plugin integrations label Oct 9, 2026
@ZaynJarvis

Copy link
Copy Markdown
Collaborator

Please rebase onto main: #5937 (621b1dd) and #5935/#5936 bumped the same plugin releases on 10-15, so the version files in this PR now conflict (main now has agent-hook 0.5.21, claude-code 0.7.12, codex 0.11.11, dsh 0.5.26, opencode 0.5.17 and pi 0.4.20). After rebasing, bump every plugin this PR touches past main and keep the dsh/pi package-lock.json files in sync with package.json.

@ktz03

ktz03 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Updated in 8c8317b: merged f64fb5b, advanced the touched plugin versions past main, and kept paired manifests and DSH/Pi locks synchronized. Focused profile-inject and release/config/sync/HTTP checks pass on Windows. Linux and the full server were not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-plugins Agent harness and plugin integrations

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

bug: SessionStart profile exceeds its UTF-8 byte cap with mixed CJK content

2 participants